package tcp.demo;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author zss
 * @date 2021/8/31 14:14
 * @Email:451682479@qq.com
 */
public class TcpServer {

    public static int port = 8010;
    /**
     * tcp需要建立连接
     */

    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = new ServerSocket(port);

        while (true){
            Socket accept = serverSocket.accept();

            ServerThread thread = new ServerThread(accept);
            thread.start();

        }
    }
}
